<?php
	require_once 'dbhelper.php';
	$lgjsn = $_POST["lgjsn"];
	$LGN = json_decode($lgjsn,true);
	
	$dbHelper = new DBHelper();
	$dbHelper->getConn("root", "root", "r1home");
	
	$result = $dbHelper->getRow("USER", array("RPassword"), array("Snumber"=>$LGN["sid"]));
	if($result === -1)
	{
		echo $dbHelper->generateCallBackMsg("查询出错，请稍后重试", -1);
	}
	else if($result === 0)
	{
		echo $dbHelper->generateCallBackMsg("该账户 不存在，请检查后重试", -1);
	}
	else
	{
		$row = mysql_fetch_array($result);
		$pwd = $row['RPassword'];
		if($pwd == md5($LGN["pwd"]))
		{
			//成功登陆
			echo $dbHelper->generateCallBackMsg("成功登陆", -1);
		}
		else 
		{
			echo $dbHelper->generateCallBackMsg("密码错误 ", -1);
		}
	}
?>